<template>
	<view style="height: 100%;">
		<nav-bar></nav-bar>
		<view class="login">
			<view class="login-info">
				<view class="title">
					<text class="name">熵简科技</text>
					<text class="text">Shang Jian Science and technology</text>
				</view>
				<view class="btn-in">
					<button class="btn" type="default" @tap="onLog">欢迎登录</button>
				</view>
			</view>
			<view class="icon iconfont iconkaiji" @click="$refs.popup.open()"></view>
		</view>
		<uni-popup ref="popup" type="center">
			<switch-log @onCQ="onCQ" @onClose="$refs.popup.close()"></switch-log>
		</uni-popup>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	import SwitchLog from '../../components/login/switch.vue'
	import NavBar from '../../components/common/nav-bar.vue'
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupMessage from '@/components/uni-popup-message/uni-popup-message.vue'
	import uniPopupDialog from '@/components/uni-popup-dialog/uni-popup-dialog.vue'
	export default {
		components: {
			uniPopup,
			uniPopupMessage,
			uniPopupDialog,
			NavBar,
			SwitchLog
		},
		data() {
			return {
				
			}
		},
		computed:{
			...mapState(['mainCabinet'])
		},
		onLoad() {

		},
		methods: {
			onLog() {
				// uni.redirectTo({
				// 	url: '../login/login'
				// })
				console.log(this.mainCabinet.terminalId);
				if(this.mainCabinet.terminalId==null){
					uni.redirectTo({
						url: '../found-id/found-id'
					})
					
				}else{
					uni.redirectTo({
						url: '../login/login'
					})
				}
			},
			onCQ() {
				uni.redirectTo({
					url: "../welcome-login/welcome-login"
				})
			}
		}
	} 
</script> 

<style scoped lang="less">
.login{
	display: flex;
	justify-content: center;
	position: relative;
	background: url(../../static/background3.jpg) no-repeat;
	background-size: cover;
	height: calc(100vh - 72px);
	// height: 385rpx;
	box-sizing: border-box;
	.login-info{
		position: relative;
		z-index: 3;
		.title{
			margin-top: 25vh;
			margin-bottom: 22vh;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			text-align: center;
			.name{
				color: #FFFFFF;
				font-size: 156rpx;
				font-weight: 400;
				letter-spacing: 30rpx;
				margin-left: 40rpx;
			}
			.text{
				color: #D7F0FF;
				font-size: 41rpx;
			}	
		}
		.btn-in{
			display: flex;
			justify-content: center;
			align-items: center;
			.btn{
				display: flex;
				justify-content: center;
				align-items: center;
				background:linear-gradient(11deg, rgba(255, 184, 122, 1), rgba(251, 121, 89, 1), rgba(255, 154, 114, 1));
				color: #FFFFFF;
				width: 600rpx;
				height: 150rpx;
				border-radius: 128rpx;
				font-size: 68rpx;
			}
			
		}
	}	
	.iconkaiji{
		position: absolute;
		// left: 64rpx;
		// bottom: 52rpx;
		left: 5vh;
		bottom: 5vh;
		color: #FFFFFF;
		font-size: 75rpx;
		z-index: 2;
	}
	
}


</style>
